package com.itheima.fanshe;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.concurrent.Callable;

/*
获取类的 属性
 */
public class Demo08 {

    public static void main(String[] args) throws ClassNotFoundException, NoSuchFieldException {
        Class clazz = Class.forName("com.itheima.domain.Student");
        Field[] fields = clazz.getFields();
        System.out.println(Arrays.toString(fields));

        Field[] declaredFields = clazz.getDeclaredFields();
        System.out.println(Arrays.toString(declaredFields));

        Field gender = clazz.getField("gender");
        Field money = clazz.getField("money");
        System.out.println(gender);
        System.out.println(money);
        Field name = clazz.getDeclaredField("name");
        Field age = clazz.getDeclaredField("age");
        System.out.println(name);
        System.out.println(age);

    }
}
